﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace BaoJian.member.exchange
{
    public partial class FinishedOrders : System.Web.UI.Page
    {
        private string UserID = HttpContext.Current.User.Identity.Name;
        private LYQ.BLL.ExchangeProduct bll = new LYQ.BLL.ExchangeProduct();
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Tools.Common.IsAuthenticated();
                BindData();
            }
        }
        private void BindData()
        {

            string where = "[CustomerID]='{0}' and ([Publish]='互换成功') order by OrderID desc";
            where = string.Format(where, UserID);
            DataSet ds = bll.GetList(where);
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();
        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            BindData();
        }     
    }
}
